{% load common_extras %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div class="left">
    <a href="{% url 'index' %}">首页</a>
</div>
{#当变量值有的时候显示变量值，没有的时候就显示默认值#}
{#<div class="right">{{ user.name|default:"登录"|capfirst }}</div>#}
{#<div class="right">{{ user.name|default:"登录"|my_capfirst }}</div>#}
<div class="right">
    <a class="func" href="{% url 'AddArticle' %}">
        <span>发布</span>
    </a>
<a class="func" href="{% url 'ArticleUser' %}">
    <span>个人中心</span>
</a>

    {% if username %}
        {{ username|capfirst }}
        <a href="{% url 'logout' %}">退出登录</a>
    {% else %}
        <a href="{% url 'login' %}">立即登录</a>
    {% endif %}
    {#    {{ username.name|mydefault:"登录"|my_capfirst }}|{% crt "%Y-%m-%d %H:%M:%S" %}#}

</div>

</body>
</html>